﻿
@{
    Layout = null;
}

<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>Login</title>
    <link href="~/Scripts/Bootstrap/css/bootstrap.min.css" rel="stylesheet" />
    <style>
        body {
            background-color: rgb(250,250,250);
        }

        .col-center-block {
            float: none;
            display: block;
            margin-left: auto;
            margin-right: auto;
            width: 80%;
            padding-top: 150px;
            text-align: center;
        }

        .form-control-feedback {
            left: 0 !important;
        }

        .form-control {
            padding-left: 30px;
        }

        .img-responsive {
            display: inline-block;
            margin-bottom:20px;
        }
    </style>
</head>
<body>
    <div class="container">
        <div class="row myCenter">
            <div class="col-center-block">
                <img src="~/Content/webImgs/TraceSource/index/LoginTitle.png" class="img-responsive" />
                <h3 style="margin-bottom:40px;">产品身份的贴身管家</h3>
                <div style="margin-bottom:50px;">
                    <a id="ret" href="">
                        <img src="~/Content/webImgs/TraceSource/index/index_ios.png" style="height:16px;" />
                    </a>
                </div>
                <form class="form-signin" id="UserForm">

                    <div class="form-group has-feedback">
                        <label for="username" class="sr-only">用户名</label>
                        <span class="glyphicon glyphicon-user form-control-feedback"></span>
                        <input type="text" id="UserName" name="UserName" class="form-control" placeholder="请输入用户名" required autofocus>
                    </div>

                    <div class="form-group has-feedback">
                        <label for="inputPassword" class="sr-only">密码</label>
                        <span class="glyphicon glyphicon-lock form-control-feedback"></span>
                        <input type="password" id="Password" name="Password" class="form-control" placeholder="请输入密码" required>
                    </div>

                    <button type="button" class="btn btn-ms btn-info btn-block" onclick="Login()">登录</button>
                </form>
            </div>
        </div>
    </div>
</body>
</html>

@*<script src="~/Scripts/jquery.js"></script>*@
<script src="~/Scripts/jquery-3.3.1.min.js"></script>

<script>


    function Login() {
        var UserName=$("#UserName").val();
        var Password = $("#Password").val();
        $.ajax({
            type: "POST",
            url: "/Mobile/Login",
            dataType: 'json',
            data: { UserName: UserName, Password: Password },
            success: function (data) {
               
                if (data.IsLogin == false) {
                    $.L.msgError(data.Msg);
                } else {
                    window.location="/Mobile/TempletNodeList"
                }
            },
            error: function (e) {
                $.L.msgError("network error");
            }
        });

    }


  







</script>


